package com.hp.bon.sgw.stdbss30.utils;

import org.dom4j.Element;

import com.hp.bon.logreverse.ExtractHelper;
import com.hp.bon.sgw.bean.XmlMessage;

public class XmlMessageUtils {

	public static String getAreaCode(XmlMessage xmlMessage) {
		Element dataElement = xmlMessage.getDataElement();
		return ExtractHelper.getXmlNodeValue(dataElement, "/Service_Information/Area_Code");
	}

	public static String getLatnCode(XmlMessage xmlMessage) {
		Element dataElement = xmlMessage.getDataElement();
		return ExtractHelper.getXmlNodeValue(dataElement, "/Service_Information/Bill_Information/Latn_Id");
	}
	
	public static String getCapability(XmlMessage xmlMessage) {
		String scid = xmlMessage.getSCID();
		String capability = scid.substring(0, scid.indexOf('@'));
		return capability;
	}
	
}
